<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        // 深复制复制的是值 浅复制 复制的是地址
        let arr = [12, 3, 3];
        // let arr2 = arr;
        // arr2[1] = "aaa";
        // console.log(arr, arr2);
        //浅复制带来的问题是一个变了 都会跟着改变

        // let arr3=JSON.parse(JSON.stringify(arr))
        let arr3 = arr.concat();
        arr3[1] = "aaa";
        console.log(arr, arr3);
    </script>
</body>

</html>